﻿<%@ Page Language="C#" AutoEventWireup="true" 
CodeBehind="RecepcionDocInsertForm.aspx.cs" 
Inherits="UILGestion.ObraAdmin.RecepcionDoc.RecepcionDocInsertForm" %>

<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc2" %>
<%@ Register src="../../AlmacenAdmin/NotaIngresoListGrid.ascx" tagname="NotaIngresoListGrid" tagprefix="uc5" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<%@ Register assembly="EstandarControl" namespace="EstandarControl" tagprefix="cc1" %>
<%@ Register src="~/Control/menuObraCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>
 <%@ Register src="RendicionDocGrid.ascx" tagname="RendicionDocGrid" tagprefix="uc2" %>
 
<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../resources/css/main.css" rel="stylesheet" type="text/css" />
     <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
    <script src="../../Scripts/RecepcionDoc.js" type="text/javascript"></script>
   <script src="../../Scripts/SearchResult.js" type="text/javascript"></script>
    <title>RECEPCION DOCUMENTO</title>
    
    <style type="text/css">
        .style4
        {
            width: 11px;
            height: 12px;
        }
    </style>
    
    </head>
    
    <body>
        <form id="form1" runat="server" autocomplete="off">
        
            <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
            <asp:ToolkitScriptManager 
                ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true"  
                EnablePartialRendering="true"></asp:ToolkitScriptManager>
                  
       <input id="idObra" type="hidden" runat="server" />
       <input id="internalid" type="hidden" runat="server" />
       <input id="idordenAnticipo" type="hidden" runat="server" />
       <input id="idColeccion" type="hidden" runat="server" />
       <input id="tipoDocumentoOrden" type="hidden" runat="server" />
       
       <input id="type" type="hidden" runat="server" />
       <input id="idComparativo" type="hidden" runat="server" />
       <asp:Panel ID="pnlMain" runat="server" Visible="false"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
                 
                 <asp:Label ID="Label1" runat="server" Text="RECEPCION DOCUMENTO" 
                         style="font-size: large; color: #960818"></asp:Label>
                         </asp:Panel>

 <asp:Panel ID="PanelButtom" runat="server"     class="ms-crm-Form-Body">
                   <table >
<tr>

<td>
    <asp:Button ID="saveButton" runat="server" Text="Guardar"    CssClass="ms-crm-List-Header"   OnClientClick="return confirm('Usted quiere Guardar el Documento?')" 
       OnClick="btnContinue_OnClick"     /></td>
     

<td>
    <asp:Button ID="cancelarButton" runat="server" Text="Cancelar"    CssClass="ms-crm-List-Header"  
       OnClick="btnContinue_OnClick" Width="80px" /></td>
          <td>
     <asp:Button ID="refreshButton" runat="server" Text="Restablecer"    CssClass="ms-crm-List-Header"  
        onclick="btnContinue_OnClick"  /></td>
        <td>

      </tr></table>
  
     </asp:Panel>

<asp:Panel ID="PanelBody" runat="server"  BackColor="white" >
  
    
         <asp:UpdatePanel ID="DocumentoUpdatePanel" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
         
         <asp:Panel runat="server" GroupingText="Orden de Compra" BorderColor="LightSteelBlue" BackColor="white"
          ID="Ordenpanel">
               <table class="ui-accordion">
                <tr>
                    <td align="right" width="100px">
                        Fecha Emision:
                    </td>
                    <td width="200px">
                        <asp:Label ID="fechaOCLabel" runat="server"></asp:Label>
                    </td>
                    <td width="100px" align="right">
                        Proveedor:</td>
                    <td width="350px">
                         <asp:HyperLink ID="ordenCompraHLk" ForeColor="Blue" runat="server"></asp:HyperLink>
                        <lib:Input id="idordenCompra" runat="server"  Width="0px" ReadOnly="true" />
                       
                    </td>
                    <td rowspan="6">
                        <table class="PanelTotales">
                            <tr>
                                <td align="right" width="100px" >
                                    Neto:</td>
                                <td  width="100px"  align="right">
                                    <asp:Label ID="simbolLabel1" runat="server" Text="Label"></asp:Label>
                                    <asp:Label ID="netoLabel" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    IGV:</td>
                                <td width="100px"  align="right">
                                    <asp:Label ID="simbolLabel2" runat="server" Text="Label"></asp:Label>
                                    <asp:Label ID="igvtotalLabel" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    Total:</td>
                                <td width="100px"  align="right">
                                    <asp:Label ID="simbolLabel3" runat="server" Text="Label"></asp:Label>
                                    <asp:Label ID="totalTextBox" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right" width="100px">
                        Num Orden:</td>
                    <td width="200px">
                        <asp:HyperLink ID="docRefHLK" runat="server" ForeColor="Blue" />
                    </td>
                    <td width="100px" align="right">
                        Moneda:
                    </td>
                    <td width="350px">
                        <asp:Label ID="monedaLabel" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" width="100px">
                        Comparativo:
                    </td>
                    <td width="200px">
                        <asp:HyperLink ID="comparativoHLK" runat="server" ForeColor="Blue" />
                    </td>
                    <td width="100px" align="right">
                        Forma Pago:
                    </td>
                    <td width="350px">
                        <asp:Label ID="formaPagoLabel" runat="server"></asp:Label>
                    </td>
                </tr>
                   <tr>
                       <td align="right" width="100px">
                           Factura Ref:</td>
                       <td width="200px">
                           <asp:HyperLink ID="facturaHLK" runat="server" ForeColor="Blue" />
                       </td>
                       <td align="right" width="100px">
                           &nbsp;</td>
                       <td width="350px">
                           &nbsp;</td>
                   </tr>
                   <tr>
                       <td align="right" width="100px">
                           Observación:</td>
                       <td width="200px" colspan="3">
                           <asp:Label ID="observacionLBL" runat="server" Text="Label"></asp:Label>
                       </td>
                   </tr>
                   <tr>
                       <td align="right" width="100px">
                           Observación Interna:</td>
                       <td width="200px" colspan="3">
                           <asp:Label ID="observacionInterLBL" runat="server" Text="Label"></asp:Label>
                       </td>
                   </tr>
            </table>
          

            
 </asp:Panel>

  <asp:Panel ID="adelantoPanel" runat="server" GroupingText="Adelantos de la Orden de Compra" BorderColor="LightSteelBlue" BackColor="white">
                    
       <asp:GridView ID="adelantogridView" runat="server" SkinID="GridView"  
           AutoGenerateColumns="false" 
           onselectedindexchanged="adelantogridView_SelectedIndexChanged">
       <Columns>
                        <asp:BoundField DataField="fecha" HeaderText="FECHA" SortExpression="fecha" ItemStyle-Width="70px" DataFormatString="{0:d}" /> 
                        <asp:BoundField DataField="descripcion" HeaderText="DESCRIPCION" SortExpression="codigo" ItemStyle-Width="250px" /> 
                        <asp:BoundField DataField="total" HeaderText="TOTAL" SortExpression="fechaDoc" ItemStyle-Width="70px" /> 
                        <asp:BoundField DataField="factura" HeaderText="FACTURA" SortExpression="fechaDoc" ItemStyle-Width="70px"/> 
        </Columns>
       </asp:GridView> 
       
        
   </asp:Panel>
         


   <asp:Panel ID="Panel3" runat="server" GroupingText="Ingresos Almacen" BorderColor="LightSteelBlue" BackColor="white">
                  
                  
                
         <asp:UpdatePanel ID="UpdatePanel2" runat="server"  UpdateMode="Conditional">
         <ContentTemplate>
         <uc5:NotaIngresoListGrid ID="NotaIngresoListGrid2" runat="server"
             
              DataSourceID="NotaIngresoListODS" />

             <asp:ObjectDataSource ID="NotaIngresoListODS" 
              runat="server"
             EnablePaging="True"
              SelectCountMethod="Count" 
              SortParameterName="sortExpression"
             SelectMethod="GetNotaIngresoList" 
             typeName="BOL.NotaIngresoBL" >
               <SelectParameters>
                 <asp:querystringparameter  Name="idOrdenCompra" Type="Int32" querystringfield="idOC"  />
                 <asp:Parameter Name="startRowIndex" Type="Int32" />
                 <asp:Parameter Name="maximumRows" Type="Int32" />
                 <asp:Parameter Name="sortExpression" Type="String" />

                </SelectParameters>
               </asp:ObjectDataSource>
         </ContentTemplate>
         <Triggers>
         <asp:AsyncPostBackTrigger ControlID="refreshButton" />
         </Triggers>
         </asp:UpdatePanel>
        
  
                  
                  
    
        
   </asp:Panel>
         



          <asp:Panel ID="facturacionUNOPNL" runat="server" GroupingText="Facturacion" BorderColor="LightSteelBlue" BackColor="white">
          <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                             <ContentTemplate>
              
 <table >
                <tr>
                    <td>
                        <table >
                            <tr>
                                <td  width="100px" align="center" colspan="2">
                                     <asp:CheckBox ID="envioGPUNOchk" runat="server" BackColor="#2D3E5B" 
                                        BorderColor="#CC0000" Font-Bold="True" Font-Size="XX-Small" ForeColor="White" 
                                        Text="ENVIAR DOCUMENTO SISTEMA GESPAG" Width="250px" 
                                        ToolTip="Exporta la información del documento y Proveedor al sistema  GESPAG al momento de guardar el FR" />
                                     <br />
                                </td>
                                
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    F/R:</td>
                                <td width="150px">
                                    <asp:TextBox ID="FRUNITXT" runat="server" TabIndex="1"></asp:TextBox>
                                    <img alt="" class="style4" src="../../Images/req.gif" />
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Fecha Recepción: 
                                </td>
                                <td>
                                    <asp:TextBox  ID="FecharecepcionTXT" runat="server" TabIndex="2"></asp:TextBox>
                                    <asp:ImageButton ID="ImageButton3" runat="Server" 
                                        AlternateText="Click aqui para mostrar calendario" 
                                        ImageUrl="~/Images/month.gif" Width="16px" />
                                    <asp:CalendarExtender ID="fechaVencimTextBox0_CalendarExtender" runat="server" 
                                        PopupButtonID="ImageButton3" TargetControlID="FecharecepcionTXT">
                                    </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Tipo Documento: 
                                </td>
                                <td>
                             <asp:DropDownList ID="tipoDocDropDownList" Width="220px" runat="server" TabIndex="3"  AutoPostBack="true"
                                        onselectedindexchanged="tipoDocDropDownList_SelectedIndexChanged"  ></asp:DropDownList>
                           
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Num. Documento: 
                                </td>
                                <td>
                                    <asp:TextBox ID="documentoTextBox" runat="server" Width="150px" 
                                        TabIndex="4"></asp:TextBox>
                                    <img alt="" class="style4" src="../../Images/req.gif" />
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Moneda:</td>
                                <td>
                             <asp:DropDownList ID="monedaDropDownList" runat="server"   
                                 Width="150px" TabIndex="5"></asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <table class="ui-accordion">
                            <tr>
                                <td align="right" width="100px">
                 Glosa:</td>
                                <td>

                            <lib:Input ID="descripcionTextBox" runat="server" backcolor="#DFE8F6" Width="350px"
                            DataType="List" method="GetOrdenCompraItem" TabIndex="6"  
                             />
                            
                                </td>
                                <td rowspan="8" valign="top">
                                <asp:UpdatePanel runat="server" ID="totalesUPNL">
                                <ContentTemplate>
                                 <asp:Panel ID="facturaPNL" runat="server">
                                    <table class="PanelTotales">
                                        <tr>
                                            <td align="right" width="100px">
                                                <b>Base Imponible: </b>
                                            </td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="totalNetoTXT" runat="server" DataType="Double" TabIndex="10" 
                                                    Width="80px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                                <strong>Base Inafecto:</strong></td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="totalInafectoTXT" runat="server" DataType="Double" TabIndex="10" 
                                                    Width="80px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                                <b>IGV<asp:TextBox ID="IGVValor" Width="20px"  runat="server" BorderStyle="None" BackColor="Transparent"></asp:TextBox>
                                                &nbsp; %: </b>
                                            </td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="IGVTXT" runat="server" DataType="Double" TabIndex="11" 
                                                    Width="80px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                                <strong>ISC:</strong></td>
                                            <td align="right" width="100px">
                                                
                                                <lib:Input ID="iscTXT" runat="server" DataType="Double" TabIndex="12" 
                                                    Width="80px"></lib:Input>
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                                <strong>Total:</strong></td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="totalFinalTXT" runat="server" DataType="Double" TabIndex="12" 
                                                    Width="80px"></lib:Input>
                                                
                                            </td>
                                        </tr>
                                    </table>
                                    </asp:Panel>
                                     <asp:Panel ID="HonorarioPNL" runat="server">
                                      <table class="PanelTotales">
                                        <tr>
                                            <td align="right" width="100px">
                                                <b>Importe Honorario: </b>
                                            </td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="importeHonorarioTXT" runat="server" DataType="Double" TabIndex="10" 
                                                    Width="80px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                               <strong> Ret. Renta 4ta.:</strong></td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="ren4TXT" runat="server" DataType="Double" TabIndex="10" 
                                                    Width="80px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" width="100px">
                                                <strong>Importe Neto:</strong></td>
                                            <td align="right" width="100px">
                                                <lib:Input ID="ImporteNetoTXT" runat="server" DataType="Double" TabIndex="12" 
                                                    Width="80px"></lib:Input>
                                                
                                            </td>
                                        </tr>
                                    </table>
                                       </asp:Panel>
                                       </ContentTemplate>
                                       <Triggers>
                                       <asp:AsyncPostBackTrigger ControlID="tipoDocDropDownList" />
                                       <asp:AsyncPostBackTrigger ControlID="fechaEmisonTextBox" />
                                       </Triggers>
                                       </asp:UpdatePanel>
                                </td>

                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Fecha Emision:</td>
                                <td>
                                    <asp:TextBox ID="fechaEmisonTextBox" runat="server" AutoPostBack="True" 
                                        ontextchanged="fechaEmisonTextBox_TextChanged" TabIndex="7"></asp:TextBox>
                                    <asp:ImageButton ID="ImageButton2" runat="Server" 
                                        AlternateText="Click aqui para mostrar calendario" 
                                        ImageUrl="~/Images/month.gif" Width="16px" />
                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="ImageButton2" 
                                        TargetControlID="fechaEmisonTextBox">
                                    </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Fecha Vencimiento: 
                                </td>
                                <td>
                                    <asp:TextBox ID="fechaVencimTextBox" runat="server" TabIndex="8"></asp:TextBox>
                                    <asp:ImageButton ID="ImageButton32" runat="Server" 
                                        AlternateText="Click aqui para mostrar calendario" 
                                        ImageUrl="~/Images/month.gif" Width="16px" />
                                    <asp:CalendarExtender ID="CalExt2" runat="server" PopupButtonID="ImageButton32" 
                                        TargetControlID="fechaVencimTextBox">
                                    </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                              Tipo Cambio $: 
                                </td>
                                <td>
                                    <asp:TextBox ID="TipoCambioTXT" runat="server"></asp:TextBox>
                                    <img alt="" class="style4" src="../../Images/req.gif" />
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                             Fecha Pago:</td>
                                <td>
                             <asp:DropDownList ID="fechaPagoDDL" runat="server" Width="200px" TabIndex="9">
                             </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right" width="100px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

          </ContentTemplate>
          </asp:UpdatePanel>
 </asp:Panel>




   
    <asp:Panel ID="GrupoFacturacionPNL" runat="server" GroupingText="Facturacion" BorderColor="LightSteelBlue" BackColor="white">
          <asp:UpdatePanel ID="tipoCambioUpdatePanel" runat="server" UpdateMode="Conditional">
                             <ContentTemplate>
              
                    <table>
           <tr><td colspan="4">
               <asp:CheckBox ID="envioGPGRUPOchk" runat="server" BackColor="#2D3E5B" 
                   BorderColor="#CC0000" Font-Bold="True" Font-Size="XX-Small" ForeColor="White" 
                   Text="ENVIAR DOCUMENTOS SISTEMA GESPAG" Width="250px"
                           ToolTip="Exporta la información del documento y Proveedor al sistema  GESPAG al momento de guardar el FR"  />
               <br />
               </td>
                        </tr>
                        <tr>
                            <td>
                                FR:</td>
                            <td >
                                <asp:TextBox ID="frLabel" runat="server" TabIndex="1"></asp:TextBox><img alt="" class="style4" src="../../Images/req.gif" />
                            </td>
                            <td>
                                
                                Fecha Recepción:</td>
                            <td  width="200px">
                                <asp:TextBox ID="fechaTextBox" runat="server" AutoPostBack="True" TabIndex="2" 
                                    Width="80px"></asp:TextBox>
                                <asp:ImageButton ID="ImageButton1" runat="Server" 
                                    AlternateText="Click aqui para mostrar calendario" 
                                    ImageUrl="~/Images/month.gif" Width="16px" />
                                <asp:CalendarExtender ID="CalExt1" runat="server" PopupButtonID="ImageButton1" 
                                    TargetControlID="fechaTextBox">
                                </asp:CalendarExtender>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
           </table>
            <uc2:RendicionDocGrid ID="RendicionDocGrid1" runat="server" />
           <p></p><p></p>

                  </ContentTemplate>
                              
                              </asp:UpdatePanel>
 </asp:Panel>
                 
                  </ContentTemplate>
         </asp:UpdatePanel>  
                 
  </asp:Panel>
           
       
      
           
     
       
      
           
    </form>
</body>
</html>
